<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head th:replace="public/index :: CSS(~{::title})">
    <title>日记的列表</title>
</head>

<body>
<!--菜单栏-->
<nav th:insert="~{public/index :: indexHead}"></nav>
<!--我的日记列表-->
<section class="blog-wrapper sect-pt4" id="blog">
    <div class="container">
        <div class="row">
            <div class="col-md-8">
                <div class="box-comments">
                    <div class="title-box-2">
                        <h4 class="title-comments title-left">Godz的故事([[${countAll}]])</h4>
                    </div>
                    <!-- 一页放六组 -->
                    <ul class="list-comments">
                        <li th:each="list:${storyList6}">
                            <div class="comment-avatar">
                                <img th:src="${list.getStoryImg1()}" alt=""/>
                            </div>
                            <div class="comment-details">
                                <h4 class="comment-author" th:text="${list.getStoryTitle()}"></h4>
                                <span th:text="${#dates.format(list.getStoryDate(), 'yyyy-MM-dd')}"></span>
                                <p th:text="${list.getHumorTitle()}"></p>
                                <a th:href="'/myStory?id='+${list.getId()}">了解详情</a>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="col-md-4">
                <div class="widget-sidebar sidebar-search">
                    <!-- 换页按钮 -->
                    <div class="sidebar-content">
                        <h5 class="sidebar-title">第[[${pageNow}]]页&nbsp;&nbsp;共[[${pageAll}]]页</h5>
                        <a class="npbtn" th:href="'/myStoryList?pageNow='+(${pageNow}-1)+'#blog'"
                           th:if="${pageNow} ne 1">上一页</a>
                        <a class="npbtn" th:href="'/myStoryList?pageNow='+(${pageNow}+1)+'#blog'"
                           th:if="${pageNow} lt ${pageAll}">下一页</a>
                        <br>
                        <script src="assets/myIndex/lib/jquery/jquery.min.js"></script>
                        <form id="form" th:action="@{/addGoods}" method="post">
                            <div class="input-group">
                                <input type="number"
                                       class="form-control"
                                       id="skipPage"
                                       name="skipNumber"
                                       placeholder="输入你想跳转的页数"
                                />
                                <span class="input-group-btn">
                                <button
                                    class="btn btn-secondary btn-search"
                                    type="button"
                                    onclick="verify()">跳
                                </button>
                                </span>
                            </div>
                        </form>
                        <!-- 跳转验证 -->
                        <script>
                            function verify() {
                                //调用方式
                                $().getFuc();
                            };
                            $(function () {
                                $.fn.getFuc = function () {
                                    let skip = $('#skipPage').val();
                                    if (Math.floor(skip) != skip || skip < 1) {
                                        alert("请填写整数,不能含有小数等,甚至负数");
                                        return
                                    }
                                    if ([[${pageAll}]] < skip) {
                                        alert("超过总页数,没有那么多可以看!");
                                        return
                                    }
                                    $("#form").submit();
                                }
                            })
                        </script>
                    </div>
                </div>
                <div class="widget-sidebar">
                    <h5 class="sidebar-title">近期精彩事件</h5>
                    <div class="sidebar-content">
                        <ul class="list-sidebar">
                            <li th:each="imp:${Imp5}">
                                <a th:href="'/myStory?id='+${imp.getId()}" th:text="${imp.getStoryTitle()}"></a>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="widget-sidebar">
                    <h5 class="sidebar-title">Godz重点事件</h5>
                    <div class="sidebar-content">
                        <ul class="list-sidebar">
                            <li>
                                <a href="#">入职大厂</a>
                            </li>
                            <li>
                                <a href="#">Godz毕业了</a>
                            </li>
                            <li>
                                <a href="#">被感染的Godz</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<!--底层内容-->
<nav th:insert="~{public/index :: indexFooter}"></nav>
<!--一键回头-->
<a href="#" class="back-to-top"><br>顶</a>
<div id="preloader"></div>
<!-- 公共的JS文件 -->
<nav th:insert="~{public/index :: indexJs}"></nav>
</body>

</html>
